import request from '@/utils/request'

//查询列表页数据
export function queryPageList(data) {
  return request({
    url: '/crm/bizCrmCustomer/queryPageList',
    method: 'post',
    data: data
  })
}
//根据ID查询
export function queryByIdCustomer(customerId) {
  return request({
    url: '/crm/bizCrmCustomer/queryById/'+customerId,
    method: 'post',
  })
}
//客户标星
export function starCustomer(customerId) {
  return request({
    url: '/crm/bizCrmCustomer/star/'+customerId,
    method: 'post',
  })
}


//查询新增所需字段
export function queryCustomerField(id) {
  return request({
    url: '/crm/bizCrmCustomer/field/'+id,
    method: 'post',
  })
}

//新增数据
export function addCustomer(data) {
  return request({
    url: '/crm/bizCrmCustomer/add',
    method: 'post',
    data:data,
  })
}
//修改数据
export function update(data) {
  return request({
    url: '/crm/bizCrmCustomer/update',
    method: 'post',
    data:data,
  })
}

//添加客户地址
export function saveAddress(data) {
  return request({
    url: '/crm/bizCrmCustomer/saveAddress',
    method: 'post',
    data:data,
  })
}
//添加客户地址
export function queryAddressById(customerId) {
  return request({
    url: '/crm/bizCrmCustomer/queryAddressById/'+customerId,
    method: 'post',
  })
}
//作废客户地址
export function cancellationAddress(data) {
  return request({
    url: '/crm/bizCrmCustomer/cancellationAddress',
    method: 'post',
    data:data,
  })
}

//设置住地址
export function setIsMain(data) {
  return request({
    url: '/crm/bizCrmCustomer/setIsMain',
    method: 'post',
    data:data,
  })
}
//编辑客户地址
export function updateAddress(data) {
  return request({
    url: '/crm/bizCrmCustomer/updateAddress',
    method: 'post',
    data:data,
  })
}
//删除客户
export function deleteByIds(data) {
  return request({
    url: '/crm/bizCrmCustomer/deleteByIds',
    method: 'post',
    data:data,
  })
}

//客户放入公海
export function updateCustomerByIds(data) {
  return request({
    url: '/crm/bizCrmCustomer/updateCustomerByIds',
    method: 'post',
    data:data,
  })
}
